package com.hsteach.task;

import com.hsteach.common.utils.DateUtils;
import com.hsteach.dao.mapper.FileRotaMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 归档上月值班表
 *
 */
@Slf4j
@Component("fileRotaTask")
public class FileRotaTask {

    @Autowired
    private FileRotaMapper fileRotaMapper;

    @Scheduled(cron = "0 1 0 1 * ?")
    public void fileAll() {
        log.info("开始归档值班表");
        fileRotaMapper.fileAllByDate(DateUtils.getNowyyyyMMdd());
        log.info("归档值班表完成");
    }
}
